The present invention relates generally to tone data generating techniques, and more particularly to a method and device which are suitable for causing a general-purpose arithmetic processor, such as a CPU, to execute tone generating processing.
In many electronic musical instruments today, microprocessors are used to execute tone generating processing. In some cases, the microprocessors even execute processing to impart effects to tone data formed through the tone generating processing. It has long been a common practice, in the art, to implement such microprocessors by dedicated hardware (for example, tone generator LSI or DSP) having a circuit structure depending on a particular tone generating method employed (for example, waveform memory or FM synthesis method).
However, thanks to the recent improvement of CPU""s computing capability, electronic musical instruments have appeared where the CPU loaded in a general-purpose computer or dedicated tone generating device is programmed to execute necessary tone generating processing. Here, such a tone generating device or method will be called a xe2x80x9csoftware tone generatorxe2x80x9d, while the traditional tone generating device or method will be called a xe2x80x9chardware tone generatorxe2x80x9d.
In the software tone generator, the CPU must concurrently execute the tone generating processing and various other processing. Thus, in cases where a general-purpose computer is used to implement the software tone generator, it is desirable to carry out the tone generating processing on an operating system having a multitask function (e.g., Windows 95 (trademark) of Microsoft Corporation) in order to assure that the tone generating processing is executed without being influenced by the other processing.
But, in fact, operating systems having no multitask function (e.g., Windows 3.1 (trademark) of Microsoft Corporation) are widely used today, and there is a great need for the tone generating processing to be executed on such operating systems. With these operating systems, the execution of the tone generating processing tends to be often delayed by an influence of the other processing, which could result in a significant hindrance to the tone generation.
It is therefore an object of the present invention to provide a tone generating device and method based on a software tone generator which effectively prevent a hindrance to tone generation even when tone generating processing is executed on an operating system having no full multitask function.
In order to accomplish the above-mentioned object, the present invention provides a tone generating device which comprises: a supply section for supplying performance information; an activating section for activating tone generating processing based on the performance information a plurality of times within a predetermined time period; a tone generating section for executing the tone generating processing activated by the activating section; and a control section for controlling the tone generating processing executed by the tone generating section, in such a manner that a predetermined number of samples of tone data can be belatedly formed within the predetermined time period by tone data forming operations being effected only when the tone generating processing is actually activated by the activating section.
In addition, the present invention provides a tone generating method for causing general-purpose arithmetic processing section to execute tone generating processing on the basis of supplied performance information, which comprises: a first step of activating the tone generating processing a plurality of times within a predetermined time period; a second step of performing control over the tone generating processing in such a manner that a predetermined number of samples of tone data can be belatedly formed within the predetermined time period by tone data forming operations being effected only when the tone generating processing is actually activated by the first step; and a third step of executing the tone generating processing activated by the first step in accordance with the control by the second step.
Software tone generators are known which are designed to form a predetermined number of samples of tone data every predetermined time period and later reproduce all the formed tone data together. Generally, in such a software tone generator, tone generating processing is activated only once (at only one activating time) in each predetermined time period to form the predetermined number of samples of tone data for the time period. However, where an operating system of the software tone generator does not have a full multitask function, the tone generating processing may fail to be activated at the activating time or tends to be activated behind the activating time due to an influence of other processing. Thus, operations to form the predetermined number of samples of tone data can sometimes not be completed within the predetermined time period, which would cause a significant hindrance to the necessary tone generation.
According to the tone generating device and method of the present invention arranged in the above-mentioned manner, however, the tone generating processing is activated a plurality of times (i.e., at a plurality of activating times) within each predetermined time period. Thus, even when the tone generating processing fails to be activated at some of the activating times, the predetermined number of samples of tone data can be formed in a suitable manner within the predetermined time period, by the tone data forming operations being effected belatedly only at the other activating times when the tone generating processing is actually activated. This arrangement reliably prevents a hindrance to the tone generation.
If the tone generating processing fails to be activated at many of the activating times, there may arise a situation where the predetermined number of samples of tone data can not be formed, just by the tone data forming operations effected only when the tone generating processing is actually activated, for every tone generating channel assigned to the tone generating processing. In such a case, the number of the tone generating channels to be used for forming the tone data is reduced so as to secure formation of the predetermined number of samples of tone data.
The present invention also provides a tone generating device which comprises a supply section for supplying performance information; a first register for, when tone generating processing based on the performance information is assigned to an unused tone generating channel, storing therein a parameter for controlling the tone generating processing; a second register for, when new tone generating processing based on other performance information is assigned to the tone generating channel while the channel is not available for the new tone generating processing, storing therein a parameter for controlling the new tone generating processing; a selecting section for selecting the first register before a predetermined time point to start the new tone generating processing and selecting the second register after the predetermined time point; and a tone generating section for generating tone data in the tone generating channel by use of one of the first and second registers selected by the selecting section.
In addition, the present invention provides a tone generating method for causing general-purpose arithmetic processing section to execute tone generating processing on the basis of supplied performance information, which comprises a first step of assigning tone generating processing to an unused tone generating channel and storing a parameter for controlling the tone generating processing into a first register; a second step of, when new tone generating processing is assigned to the tone generating channel while the channel is not available for the new tone generating processing, storing a parameter for controlling the new tone generating processing into a second register; a third step of selecting the first register before a predetermined time point to start the new tone generating processing and selecting the second register after the predetermined time point; and a fourth step of generating tone data in the tone generating channel by use of one of the first and second registers selected by the third step.
In the known software tone generator, if the tone generating processing fails to be activated at the activating time or is activated behind the activating time due to an influence of other processing, the interval between a time when performance information is supplied and a time when the tone generating processing based on performance information is later started will become longer. As a result, there may arise a situation where many of the tone generating channels can not initiate the tone generating processing with their associated registers having stored therein parameters for controlling the processing. If new tone generating processing based on newly supplied performance information is assigned to any of such channels still in use for the current tone generating processing, parameters for controlling the new tone generating processing can not be accepted into the associated register for a long time until the current tone generating processing is completed in the channel; namely, the new tone generating processing can not be prepared in the channel. Thus, even if the tone generating processing activation takes place during such a time, the new tone generating processing can not be executed in that tone generating channel, which would even further delay the tone data forming operations.
According to the tone generating device and method of the present invention arranged in the above-mentioned manner, however, when new tone generating processing based on newly supplied performance information is assigned to any of such channels that is still in use for the current tone generating processing and hence unavailable for the new tone generating processing, the new tone generating processing in the channel can be immediately prepared in the second register while securing continued execution of the current tone generating processing in the channel using the first register. This arrangement can reliable prevent an undesirable delay in the tone data formation due to the delayed preparation of the new tone generating processing.
The present invention further provides a tone generating device which composes: a supply section for supplying performance information; a plurality of output buffers for writing therein tone data; a reserving section for reserving reproduction from one or more of the output buffers prior to execution of tone generating processing; a tone generating section for generating tone data on the basis of the performance information, writing the generated tone data into any of the output buffers other than the buffers reserved by the reserving section, and reserving reproduction from the output buffer having the generated tone data written therein; and a reproducing section for reading the output buffers in order in which the reproduction has been reserved.
In addition, the present invention provides a tone generating method for causing general-purpose arithmetic processing section to execute tone generating processing on the basis of supplied performance information, which comprises a first step of reserving reproduction from one or more output buffers for writing therein tone data, prior to execution of tone generating processing; a second step of generating tone data, writing the generated tone data into any of the output buffers other than the buffers reserved by the first step, and reserving reproduction from the output buffer having the generated tone data written therein; and a third step of performing control to read the output buffers in order in which the reproduction has been reserved.
In the known software tone generator, if tone generating processing is activated behind a predetermined time due to an influence of other processing, reproduction of tones would be delayed and the tone generation would be greatly hindered.
According to the tone generating device and method of the present invention arranged in the above-mentioned manner, however, even when the tone generating processing fails to be activated within a predetermined time period, tones can be reproduced with no unwanted break as long as the tone generating processing is activated and reproduction from any of the output buffers is made before reproduction from all the reserved output buffers is completed. This arrangement can effectively expand a tolerable range of time delay, in the activation of the tone generating processing, that prevents an unwanted break in a stream of generated tones.
The present invention further provides a tone generating device which comprises a supply section for supplying performance information; an output buffer for writing therein tone data; a tone generating section for generating tone data on the basis of the performance information, writing the generated tone data into the output buffer, and reserving reproduction from the output buffer; a reproducing section for reading the output buffer in order in which the reproduction has been reserved; and a renewing section for, when the reproduction from the output buffer is not reserved in the reproducing section within a predetermined time period, discontinuing forming operations of tone data that should have been completed by the tone generating section by the time period and thereby causing the tone generating section to newly start forming operations of other tone data to be formed after the time period.
In addition, the present invention provides a tone generating method for causing general-purpose arithmetic processing section to execute tone generating processing on the basis of supplied performance information, which comprises a first step of generating tone data, writing the generated tone data into an output buffer, and reserving reproduction from the output buffer; a second step of reading the output buffer in order in which the reproduction has been reserved by the first step; a third step of, when the reproduction from the output buffer is not reserved within a predetermined time period, discontinuing forming operations of the tone data that should have been completed by the time period and thereby newly starting forming operations of other tone data after the time period.
According to the tone generating device and method of the present invention arranged in the above-mentioned manner, in case reproduction from any output buffer is not reserved within a predetermined time period, the tone generating processing is renewed so that even when the reproduction reservation can not be made in time and a temporary disturbance is caused in the tone generation, stable tone generation can be immediately restored and hence accompanying noise can be minimized.
The present invention further provides a tone generating device which comprises a supply section for supplying performance information; an activating section for activating tone generating processing based on the performance information, at a plurality of points within a predetermined time period; a tone generating section for executing the tone generating processing activated by the activating section; and a control section for performing control such that when the tone generating processing is activated at any one of the point by the activating section, a number of samples of tone data to be formed through the tone generating processing is caused to follow a predetermined target value set for the point.
In addition, the present invention provides a tone generating method for causing general-purpose arithmetic processing section to execute tone generating processing on the basis of supplied performance information, which comprises a first step of activating tone generating processing at a plurality of points within a predetermined time period; a second step of performing control such that when the tone generating processing is activated at any one of the point by the first step, a number of samples of tone data to be formed through the tone generating processing is caused to follow a predetermined target value set for the point; and a third step of executing the tone generating processing activated by the first step in accordance with the control by the second step.
According to the tone generating device and method of the present invention arranged in the above-mentioned manner, each time the tone generating processing is activated, control is performed such that tone forming operations are performed up to a specific number of samples of tone data for that activating time as a target value. Thus, a predetermined number of samples of tone data can be formed within the predetermined time period by tone data forming operations being effected only when the tone generating processing is actually activated. The target value is preferably set to allow the forming operations of the predetermined number of samples of tone data to be completed within the time period, but need not necessarily be set to such a value. Namely, in the case where reproduction from output buffers is made prior to execution of the tone generating processing as in the previously-mentioned arrangement, the target value may be set such that if formation of the predetermined number of samples of tone data is not completed within the time period, tone data left unformed in that time period can be belatedly formed in the next predetermined time. In short, the target value only needs to be set to guarantee such a tolerable range of time delay in activating the tone generating processing that does not cause an unwanted break in a stream of generated tones.
In some specific forms of the tone data forming control of the present invention, a time delay in the tone generating processing may be accommodated by adding all left-unformed tone data (all tone data that failed to be formed at a particular activating time) to the number of samples to be formed in response to next activation of the processing, or by increasing the number of samples to be formed in response to each subsequent activation by a uniform quantity or by a quantity proportional to the number of the left-unformed tone data.